﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mbine.msgc.model
{
    public class CPart : IPart
    {
        public List<IUser> Users { get; set; }
        public List<IPart> Parts { get; set; }
        public string Key { get; set; }
        public string Name { get; set; }
        public string PartCode { get; set; }
        public int Order { get; set; }
        public bool IsCustom { get; set; }       //사용자가 직접 만든것인가?

        public CPart()
        {
            Users = new List<IUser>();
            Parts = new List<IPart>();
            IsCustom = false;
        }

        public List<object> Items {
            get
            {
                List<object> childNodes = new List<object>();
                foreach (var group in Parts)
                    childNodes.Add(group);
                foreach (var entry in Users)
                    childNodes.Add(entry);

                return childNodes;
            }
        }
    }
}
